package com.example.demo.service;

import java.util.List;
import java.util.Optional;

import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;

@Service
public interface BaseService<T> {

	List<T> findAll();
	List<T> findAll(Example<T> example);
	Page<T> findAll(Pageable pageable);
	List<T> findAll(Sort sort);
	Page<T> findAll(Example<T> example, Pageable pageable);
	List<T> findAll(Example<T> example, Sort sort);
	Iterable<T> findAllById(Iterable<String> ids);
	Optional<T> findById(String id);
	Optional<T> findOne(Example<T> example);
	
	void save(T entity);
	
	public void updateNotNull(T entity) throws Exception;
}
